package com.hnas.sys.service.upload;

import java.io.IOException;
import java.io.OutputStream;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;

import org.springframework.web.multipart.MultipartFile;
import org.xml.sax.SAXException;

import com.hnas.core.exception.CommonException;
import com.hnas.core.exception.EntityNotFoundException;
import com.hnas.sys.exception.ValidationCodeException;
import com.hnas.sys.service.upload.dto.DTOAttachment;

public interface UploadService {
	
	DTOAttachment getAttchment(long id,int authCode) throws EntityNotFoundException,ValidationCodeException;
	/**
	 * <pre></pre> 
	 *@auther 周勇（zhou-y）
	 * 2013-9-27
	 * @param file
	 * @return
	 */
	DTOAttachment uploadFile(MultipartFile file) throws CommonException ;
	 /**
	 * <pre>下载文件</pre> 
	 *@auther 周勇（zhou-y）
	 * 2013-9-27
	 * @param fileName
	 * @param fileShowName
	 * @param out
	 */
	void downLoadFile(String uri, OutputStream out)throws CommonException, IOException;
	
	/**
	 * <pre></pre> 
	 *@auther 周勇（zhou-y）
	 * 2015-4-28
	 * @param s
	 * @param prefix
	 * @return
	 * @throws IOException
	 */
	DTOAttachment saveFile(String s, String prefix, String relativePath) throws IOException;
	
	/**
	 * <pre></pre> 
	 *@auther 周勇（zhou-y）
	 * 2015-4-28
	 * @param fileName
	 * @return
	 * @throws ParserConfigurationException 
	 * @throws IOException 
	 * @throws SAXException 
	 * @throws TransformerConfigurationException 
	 * @throws TransformerException 
	 * @throws CommonException 
	 */
	String getFileContent(String fileName) throws SAXException, IOException, ParserConfigurationException, TransformerConfigurationException, TransformerException, CommonException;

	/**
	 * <pre></pre> 
	 *@auther 周勇（zhou-y）
	 * 2015-5-16
	 * @param fromFile
	 * @param copyValue
	 * @return
	 */
	long copyExcel(long fromFile, Object copyValue);
}
